#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h>

#define ITERACOES 1000000000

const unsigned int A = 1664525, C = 1013904223;

unsigned int next(unsigned int x)
{
    return x*A+C;
}

int main(void)
{
    unsigned int rand;
    double x, y, circulo=0;
    int i;

    rand = time(NULL);

	for(i = 0; i < ITERACOES; ++i)
	{
		rand = next(rand);
		x = (double)rand/UINT_MAX;
		rand = next(rand);
		y = (double)rand/UINT_MAX;

		if( ((x*x) + (y*y)) < 1 )
        {
            circulo++;
        }
	}

    printf("%.6lf\n", ((double)circulo/ITERACOES)*4);

}
